from scrapy.linkextractors import LinkExtractor
from scrapy.http import HtmlResponse


with open('linkextractor.html','rb') as f:
    body = f.read()
response = HtmlResponse(url="http://example.com/index", body=body)

